# coding=utf-8
from sqlalchemy import Column, Integer, String, Float

from db_models.orm_base import BaseOrmClass


class CatAbilities(BaseOrmClass):
    '''
    模型(表)备注:
能力(具体是些啥看具体定义了,可能是学科,可能是某种能力)
    '''
    __tablename__ = 'cat_abilities'

    '''   能力所属appid   '''
    appid = Column(Integer(), nullable=False, default=0)

    '''   主键ID   '''
    id = Column(Integer(), primary_key=True)

    '''   能力名称   '''
    name = Column(String(45), nullable=False)

    '''   状态 1-正常,0-禁用   '''
    status = Column(Integer(), nullable=False)

    ''' 上级ID    '''
    pid = Column(Integer(), nullable=False, default=0)

    ''' 权重    '''
    w = Column(Float(), nullable=False, default=1.0)

    '''   该能力下的试题数   '''
    qnums = Column(Integer(), default=0)

    def __repr__(self):
        return "cat_abilities(name='{self.name}',status='{self.status}')".format(self=self)

    def exclude(self): return ()
